﻿using System.ComponentModel.DataAnnotations;

namespace Competition.Admin.Web.Models.IntroductionViewModels
{
    public class IntroductionViewModel
    {
        public int Id { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        [Required(ErrorMessage = "必填", AllowEmptyStrings = false)]
        [StringLength(500, MinimumLength = 0, ErrorMessage = "{2}到{1}个字符")]
        [Display(Name = "标题")]
        public string Title { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [StringLength(1000, MinimumLength = 0, ErrorMessage = "{2}到{1}个字符")]
        [Display(Name = "描述")]
        public string Description { get; set; }
        /// <summary>
        /// 带样式正文
        /// </summary>
        [Display(Name = "内容")]
        public string Html { get; set; }
        /// <summary>
        /// 无样式正文
        /// </summary>
        [Required(ErrorMessage = "必须带有文字", AllowEmptyStrings = false)]
        [StringLength(int.MaxValue, MinimumLength = 0, ErrorMessage = "{2}到{1}个字符")]
        [Display(Name = "内容")]
        public string Text { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [Display(Name = "类型")]
        public int ClassId { get; set; }
        /// <summary>
        /// 状态:0-无效，1-有效
        /// </summary>
        [Required(ErrorMessage = "必填", AllowEmptyStrings = true)]
        [Display(Name = "状态")]
        public int Status { get; set; }
    }
}